#include "ConexionCliente.h"

ConexionCliente::ConexionCliente() : socket(TIMEOUT_CONNECT_SEC, TIMEOUT_CONNECT_USEC)
{
}

ConexionCliente::~ConexionCliente()
{
}

bool ConexionCliente::conectar(const string &server, unsigned int port){
	bool create, connect;

	create = this->socket.create();
	connect = this->socket.connect(server, port);

	return (create && connect);
}

bool ConexionCliente::shutdownAndClose(){
	bool shutdown;
	bool close;

	shutdown = this->socket.shutdown();
	close = this->socket.close();

	return (shutdown && close);
}

bool ConexionCliente::getConectado(){
	return this->socket.getConectado();
}


